package com.wang.controller;

import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.wang.entity.MemberInfo;
import com.wang.service.MemberInfoService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;
import java.util.Map;

/**
 * @Classname MemberInfoController
 * @Description TODO
 * @Date 2023/11/14 9:35
 * @Created by pc
 */
@Controller
public class MemberInfoController {

    @Autowired
    private MemberInfoService memberInfoService;

    @RequestMapping(value = "/findAll")
    @ResponseBody
    public List<MemberInfo> findAll(){
        return  memberInfoService.findAll();

    }

    @RequestMapping("/findById")
    @ResponseBody
    public MemberInfo findById(@RequestParam("id") Long id){
        return memberInfoService.findById(id);
    }
    @RequestMapping("/update")
    @ResponseBody
    public Map<String, Object> update(MemberInfo memberInfo){
        return  memberInfoService.update(memberInfo);
    }
    @RequestMapping("/del/{id}")
    @ResponseBody
    public Map<String, Object> del(@PathVariable Long id){
        return memberInfoService.del(id);
    }

}
